(function(ns, $, undefined)
{
  ns.data = {};

  var isAdmin = undefined;

  ns.data.isAdmin = function()
  {
    if(undefined == isAdmin)
    {
      $.ajax({
        url: '/isAdmin',
        async: false,
        dataType: 'json',
        success: function(data, textStatus, jqXHR)
        {
          isAdmin = data.isAdmin;
        },
        error: function(jqXHR, textStatus, errorThrown)
        {
          alert(textStatus + ': ' + errorThrown);
        }
      });
    }

    return isAdmin;
  }
}(window.utils = window.utils || {}, jQuery));